<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>ProcessEditorEvent</title>
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../styles/styles.css">
</head>
<body>

<h1>ProcessEditorEvent</h1>
<div class=navbar>
<a href="../index.html">main</a> |
<a href="index.html">exported functions</a>
</div>

<div class=shortdescr>
The <dfn>ProcessEditorEvent</dfn> function informs plugins about different internal editor events.
</div>

<pre class=syntax>
int WINAPI ProcessEditorEvent(
  int Event,
  void *Param
);
</pre>

<h3>Parameters</h3>
<div class=descr>
    <div class=dfn>Event</div>
    <div class=dfndescr>Event type.<br>
      Can be one of the following values (<a name="EDITOR_EVENTS">EDITOR_EVENTS</a> enum):

<table class="cont">
<tr class="cont"><th class="cont" width="40%">Event</th><th class="cont" width="60%">Description</th></tr>
        <tr class="cont"><td class="cont" width="40%"><a name="EE_CLOSE">EE_CLOSE</a></td>
        <td class="cont" width="60%">
          One of the internal editors is closing.<br>
          Plugins can use this event to free
          internal data structures. Note that several editors can be active at the same time.<br>

          <dfn>Param</dfn> points to an integer variable containing the EditorID parameter of the
          editor instance beeing closed. The EditorID of the current editor can be obtained earlier
          using the
          <a href="../service_functions/editorcontrol.html#ECTL_GETINFO">ECTL_GETINFO</a>
          <a href="../service_functions/editorcontrol.html">EditorControl</a> command. But the
          plugin should not call the EditorControl function when processing this event, because the
          editor is already closed.<br>

          Return value must be 0.

       <p class=note><img src="../../images/note.gif" alt="Remark for EE_CLOSE" width="10" height="10"> Remark.</p>
       <UL class=note><LI>
       Starting with FAR 1.70 build 1989 only the following commands can be used from <dfn>EE_CLOSE</dfn>
       <a href="../service_functions/editorcontrol.html#ECTL_GETINFO">ECTL_GETINFO</a> and
       <a href="../service_functions/editorcontrol.html#ECTL_GETBOOKMARKS">ECTL_GETBOOKMARKS</a>.
       </LI></UL>

        </td></tr>

        <tr class="cont"><td class="cont" width="40%"><a name="EE_READ">EE_READ</a></td>
        <td class="cont" width="60%">
          A new file has just been read. The plugin can use
          <a href="../service_functions/editorcontrol.html">EditorControl</a>
          commands to modify the read data.<br>

          <i>Param</i> equals NULL.<br>

          Return value must be 0.
        </td></tr>

        <tr class="cont"><td class="cont" width="40%"><a name="EE_SAVE">EE_SAVE</a></td>
        <td class="cont" width="60%">
          The file being edited is about to be saved. The plugin can use
          <a href="../service_functions/editorcontrol.html">EditorControl</a> commands to modify
          data before saving.<br>

          <i>Param</i> equals NULL.<br>

          Return value must be 0.
        </td></tr>

        <tr class="cont"><td class="cont" width="40%"><a name="EE_REDRAW">EE_REDRAW</a></td>
        <td class="cont" width="60%">
          The editor screen is about to redraw. Plugin can use
          <a href="../service_functions/editorcontrol.html">EditorControl</a>
          <a href="../service_functions/editorcontrol.html#ECTL_ADDCOLOR">ECTL_ADDCOLOR</a> command
          to set line colors.<br>

          <i>Param</i> can be one of the following vslue:
          <table class="cont">
            <tr class="cont"><th class="cont" width="40%">Constans</th><th class="cont" width="60%">Description</th></tr>
            <tr class="cont"><td class="cont" width="40%"><a name="EEREDRAW_ALL">EEREDRAW_ALL</a></td>
            <td class="cont" width="60%">The whole screen will be redrawn</td></tr>

            <tr class="cont"><td class="cont" width="40%"><a name="EEREDRAW_LINE">EEREDRAW_LINE</a></td>
            <td class="cont" width="60%">Only the current line will be redrawn</td></tr>

            <tr class="cont"><td class="cont" width="40%"><a name="EEREDRAW_CHANGE">EEREDRAW_CHANGE</a></td>
            <td class="cont" width="60%">Redrawing caused by text change<br><br>
              In the case of <dfn>EEREDRAW_CHANGE</dfn> the current line or the whole screen might
              be redrawn. So if changes were made to the highlighting outside the current line, it is
              recomended to call <a href="../service_functions/editorcontrol.html#ECTL_REDRAW">ECTL_REDRAW</a>
              when you finished highlighting. Otherwise those changes will be seen only after cursor
              movement or other actions that cause screen redraw. Most important is not to enter
              recursion upon doing so.
            </td></tr>
          </table>
          Return value must be 0.<br><br>
        </td></tr>

        <tr class="cont"><td class="cont" width="40%"><a name="EE_KILLFOCUS">EE_KILLFOCUS</a></td>
        <td class="cont" width="60%">Editor has lost keyboard focus.<br>
          <i>Param</i> points to a variable containing the EditorID of the editor that looses focus.<br>
          Return value must be 0.
        </td></tr>

        <tr class="cont"><td class="cont" width="40%"><a name="EE_GOTFOCUS">EE_GOTFOCUS</a></td>
        <td class="cont" width="60%">Editor received keyboard focus.<br>
          <i>Param</i> points to a variable containing the EditorID of the editor that receives focus.<br>
          Return value must be 0.
        </td></tr>
</table>
       <p class=warning><img src="../../images/warning.gif" alt="Remark for EE_REDRAW" width="10" height="10"> Attention!</p>
       <UL class=warning><LI>
       <b>When processing EE_REDRAW it is <u>HIGLY UNDESIRABLE</u> TO CALL
          <a href="../service_functions/message.html">Info.Message</a>,
          <a href="../service_functions/menu.html">Info.Menu</a>,
          <a href="../dialogapi/dialog.html">Info.Dialog</a> and
          <a href="../dialogapi/dialogex.html">Info.DialogEx</a>.
          Calling those function leads to recursive calling of EE_REDRAW.</b>
       </LI></UL>
    </div>
    <div class=dfn>Param</div>
    <div class=dfndescr>
      Points to data dependent on the event type.
    </div>
</div>

<h3>Return value</h3>
<div class=descr>
  Return value depends on the event type.<br>
  Return 0 for unknown event types.
</div>

<h3>Remarks</h3>
<div class=descr>
  <li>EE_READ is called only once for each file.</li>
  <li>EE_SAVE is called every time F2 or Shift-F2 is pressed.</li>
  <li>EE_REDRAW is called every time the screen is redrawn (for example, after moving the cursor).</li>
</div>

</body>
</html>
